package org.example.design.observer.test1;

/**
 * @author huangshen
 * @version 0
 * @description 以数字形式显示数值的类
 * @since 2022/2/11 13:58
 */
public class DigitObserver implements Observer {

    /**
     * 数值变化监控
     * @param numberGenerator 生成数值的对象的抽象类
     */
    @Override
    public void update(BaseNumberGenerator numberGenerator) {
        System.out.println("DigitObserver:" + numberGenerator.getNumber());
        try {
            Thread.sleep(100);
        } catch (InterruptedException e) {
            e.printStackTrace();
        }
    }
}
